/**
*  @file
* @description 用户模块接口文件
 */

import request from "./request"


/**
*  @method
*  @description 登录
*  @param {object} medel 用户登录信息
*/
export const login = (model) => request.post('login', model)

/**
*  @method
*  @description 获取用户
*  @param {object} medel 查询模块
*/
export const getUsers = (model) => request.get('users', { params: model })



/**
*  
*  @param {Number} id 用户id
*@param {boolean} state 要修改的状态
*/
export const changeState = (id, state) => request.put(`users/${id}/state/${state}`)


/**
*  @method
*  @description 添加用户
*  @param {object} medel 要添加的用户对象
*/
export const addUser = (model) => request.post('users', model)

export const updateUser = (model) => request.put(`users/${model.id}`, model)

// 删除
export const delUser = (id) => request.delete('users/' + id)